import { http } from '@/utils';

export const getUserInfo = () => {
  return async (dispatch, getState) => {
    // 发起请求获取用户信息
    const res = await http.get('/user/profile');

    // console.log('res', res);
    // dispatch action 交给 reducer 处理
    dispatch({ type: 'user/getUserInfo', payload: res.data.data });
  };
};
